<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>WeakMap WeakSet</title>
</head>
<body>
    <p>WeakMap WeakSet 弱引用</p>

    <script>
        const wMap = new WeaMap() // 弱引用
        function fn1() {
            const obj = { x: 100 }
            wMap.set(obj, 100) // weakMap 的 key 只能是引用类型
        }
        fn1()
    </script>
</body>
</html>